package com.rescue.forum.entity;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
/*
  用户消息
  @TableName user_message
 */
public class UserMessage implements Serializable {
    public static final Integer TYPE_SYS_MESSAGE = 0;
    public static final Integer TYPE_COMMENT_MESSAGE = 1;
    public static final Integer TYPE_ARTICLE_LIKE = 2;
    public static final Integer TYPE_COMMENT_LIKE = 3;
    public static final Integer TYPE_DOWNLOAD_ATTACHMENTS = 4;
    public static final String CHANGE_PASSWORD = "您修改了密码";

    private static final long serialVersionUID = 1L;
    /**
     * 自增ID
     */
    @NotNull(message = "[自增ID]不能为空")
    @ApiModelProperty("自增ID")
    private Integer messageId;
    /**
     * 接收人用户ID
     */
    @Size(max = 15, message = "编码长度不能超过15")
    @ApiModelProperty("接收人用户ID")
    private Integer receivedUserId;
    /**
     * 文章ID
     */
    @Size(max = 15, message = "编码长度不能超过15")
    @ApiModelProperty("文章ID")
    private String articleId;
    /**
     * 文章标题
     */
    @Size(max = 150, message = "编码长度不能超过150")
    @ApiModelProperty("文章标题")
    private String articleTitle;
    /**
     * 评论ID
     */
    @ApiModelProperty("评论ID")
    private Integer commentId;
    /**
     * 发送人用户ID
     */
    @Size(max = 15, message = "编码长度不能超过15")
    @ApiModelProperty("发送人用户ID")
    private Integer sendUserId;
    /**
     * 发送人昵称
     */
    @Size(max = 20, message = "编码长度不能超过20")
    @ApiModelProperty("发送人昵称")
    private String sendNickName;
    /**
     * 0:系统消息 1:评论 2:文章点赞  3:评论点赞 4:附件下载
     */
    @ApiModelProperty("0:系统消息 1:评论 2:文章点赞  3:评论点赞 4:附件下载")
    private Integer messageType;
    /**
     * 消息内容
     */
    @Size(max = 1000, message = "编码长度不能超过1000")
    @ApiModelProperty("消息内容")
    private String messageContent;
    /**
     * 1:未读 2:已读
     */
    @ApiModelProperty("1:未读 2:已读")
    private Integer status;
    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

}
